<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>登录注册页-艺网</title>
  <script src="js/jquery-3.5.1.js"></script>
  <script src="js/jquery.validate.min.js"></script>
  <style>
    html,body{
      margin: 0;
      padding: 0;
    }
    a{
      color: #000;
      text-decoration: none;
    }
    section{
      width: 100%;
      background-image: url(imgs/loginbg.jpg);
      background-repeat: no-repeat;
      background-position: top center;
      background-size: cover;
    }
    .bg{
      width: 100%;
      background-color: rgba(0, 0, 0, 0.5);
    }
    .logo{
      width: 100%;
      height: 220px;      
      background-image: url(imgs/logoAndText.svg);
      background-position: top 60px center;
      background-size: 360px;
      background-repeat: no-repeat;
    }
    .login{
      width: 360px;
      height: 480px;
      background-color: #fff;
      margin: 80px auto;
    }
    .login_top{
      width: 360px;
      height: 100px;
    }
    .login_top .close{
      width: 100%;
      height: 40px;
      background-color: #fff;
    }
    .login_top .close_btn{
      width: 40px;
      height: 40px;
      float: right;
    }
    .login_top .close_btn button{
      width: 40px;
      height: 40px;
      border: none;
      background-image: url(imgs/close.png);
      background-position: top 5px center;
      background-repeat: no-repeat;
      background-size: 30px;
    }
    .login_top .login_way{
      width: 100%;
      height: 60px;
      display: flex;
    }
    .login_top .login_way .account{
      width: 50%;
      height: 60px;
      font-size: 18px;
      font-weight: bold;
      line-height: 60px;
      text-align: center;
      cursor: pointer;
    }
    .login_top .login_way .account span{
      border-bottom: 3px solid #000;
    }
    .login_top .login_way .phone{
      width: 50%;
      height: 60px;
      font-size: 18px;
      line-height: 60px;
      text-align: center;
      cursor: pointer;
    }
    .login_bottom{
      width: 360px;
      height: 380px;
      position: relative;
      overflow: hidden;
    }
    .login_bottom .login_box{
      width: 720px;
      height: 380px;
      display: flex;
      flex-wrap: nowrap;
      position: absolute;
      top: 0;
      left: 0;
    }
    .login_bottom .account_login,
    .login_bottom .phone_login{
      width: 360px;
      height: 380px;
      text-align: center;
    }
    .login_bottom .account_login input{
      height: 30px;
      width: 300px;
      margin: 30px 0 0 0;
      border: none;
      outline: none;
      font-size: 16px;
      border-bottom: 2px solid #666;
    }
    .login_bottom .account_login .pass{
      text-align: right;
      margin: 10px 30px 0 0;
    }
    .login_bottom button{
      background-color: #cf680a;
      width: 300px;
      height: 40px;
      border: none;
      font-size: 16px;
      color: #fff;
      cursor: pointer;
    }
    .login_bottom .account_login .register{
      font-size: 14px;
      margin: 20px 0;
    }
    .login_bottom .account_login .register a{
      color: #cf680a;
    }
    .login_bottom .phone_login .phone_input{
      height: 30px;
      width: 300px;
      margin: 30px 0 0 0;
      border: none;
      outline: none;
      font-size: 16px;
      border-bottom: 2px solid #666;
    }
    .login_bottom .phone_login .massage_input{
      width: 150px;
      height: 30px;
      margin: 30px 0 10px 0;
      border: none;
      outline: none;
      font-size: 16px;
      border-bottom: 2px solid #666;
    }
    .login_bottom .phone_login .massage_btn{
      width: 150px;
      height: 38px;
      margin: 30px 0 10px 0;
      border: none;
      outline: none;
      font-size: 16px;
      color: #fff;
      cursor: pointer;
      background-color: #cf680a;
    }
  </style>
</head>
<body>
  <section>
    <div class="bg">
      <div class="logo"></div>
      <div class="login">
        <div class="login_top">
          <div class="close">
            <div class="close_btn">
              <button type="button"></button>
            </div>
          </div>
          <div class="login_way">
            <div class="account"><span>账号登录</span></div>
            <div class="phone"><span>手机号登录</span></div>
          </div>
        </div>
        <div class="login_bottom">
          <div class="login_box">
            <form action="" class="f1">
              <div class="account_login">
                <input type="text" name="zhanghao" placeholder="请输入手机或账号">
                <input type="password" placeholder="请输入密码">
                <div class="pass"><a href="">忘记密码?</a></div>
                <button type="submit">登录</button>
                <div class="register">还没有账号?<a href="">请注册</a></div>
              </div>
            </form>
            <form action="" class="f2">
              <div class="phone_login">
                <input type="text" placeholder="请输入手机号" class="phone_input">
                <input type="text" placeholder="短信验证码" class="massage_input">
                <input type="button" value="获取短信验证码" class="massage_btn">
                <button type="submit">登录</button>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </section>
  <script>
    var h = window.innerHeight;
    $("section").css({"height":h});
    $(".bg").css({"height":h});

    // 选择登录方式
    $(".account").on("click",function(){
      $(".phone").css({"font-weight":"normal"});
      $(".phone span").css({"border-bottom":"none"});
      $(this).find("span").css({"border-bottom":"3px solid #000"});
      $(this).css({"font-weight":"bold" });
      $(".login_box").stop().animate({"left":"0"});
    })
    $(".phone").on("click",function(){
      $(".account").css({"font-weight":"normal"});
      $(".account span").css({"border-bottom":"none"});
      $(this).find("span").css({"border-bottom":"3px solid #000"});
      $(this).css({"font-weight":"bold" });
      $(".login_box").stop().animate({"left":"-360px"});
    })


    //点击输入框
    $("input").on("click",function(){
      $(this).css({"border-bottom":"2px solid #cf680a"})
    })

    //点击关闭
    $(".close_btn button").on("click",function(){
      history.back();
    })

    $(".f1").validata({
      rules:{
        zhanghao:{
          required:true
        }
      },
      messages:{
        zhanghao:{
          required:"您输入的不是一个手机号或邮箱"
        }
      }
    })
  </script>
</body>
</html>